package com.shanghaionstar.alarm;

import java.util.HashMap;
import java.util.Map;

/**
 * 闹钟生成工厂类
 *
 * Created by Yonglang Hong on 2017/1/11.
 */
public class AlarmFactory {

    private static AlarmFactory alarmFactory = new AlarmFactory();

    public static AlarmFactory getInstance(){
        return alarmFactory;
    }

    private static Map<AlarmActionType,Alarm> alarmMap = new HashMap<>();

    static {
        alarmMap.put(AlarmActionType.VEHICLE_INSPECTION_ACTION,new VehicleInspectionAlarm());
    }

    public Alarm create(AlarmActionType actionType){
        return alarmMap.get(actionType);
    }


}
